from lxml import etree
# 第二种使用方法 *
tree = etree.HTML(open("豆瓣.html",'r', encoding="utf-8").read())
print(tree)




# 虚构类书籍
img = tree.xpath("//ul[@class='cover-col-4 clearfix']/li/a/img/@src")
print(img)


# 非虚构类书
img1 = tree.xpath("//ul[@class='cover-col-4 pl20 clearfix']/li/a/img/@src")
print(img1)
